<template>
    <div class="r_main">
        <div class="tabIn">
            <div class="tab">
                我的钱包
            </div>
        </div>
        <div class="form_con">
            <div class="outer">
                <div class="balance">
                    <div class="title">
                        <img src="@/assets/img/bag.png" alt="">
                        <span>账户余额</span>
                    </div>
                    <div class="num">
                        <span>¥ {{ userInfo.balance }}</span>
                        <div class="btn">
                            <span @click="goPage('/moneyBag/exchange')">提现</span>
                        </div>
                    </div>
                </div>
                <div class="balance zhuti">
                    <div class="title">
                        <img src="@/assets/img/zt.png" alt="">
                        <span>主题币</span>
                    </div>
                    <div class="num">
                        <span>{{ userInfo.coin }}</span>
                        <div class="btn">
                            <span @click="goPage('/moneyBag/discount')">折现</span>
                            <span @click="goPage('/moneyBag/recharge')">充值</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</template>
<script>
export default {
    data() {
        return {
            userInfo: {},
            list: []
        }
    },
    computed: {
        path() {
            return this.$route.path
        }
    },
    mounted() {
        this.getUinfo()

    },

    methods: {
        goPage(url) {
            this.$router.push({
                path: url
            })
        },
        getUinfo() {
            this.$api.getUserInfo().then(res => {
                if (res.data.code == 1) {
                    this.userInfo = res.data.data
                }
            })
        },
        confirm(item) {
            console.log(item);

        },

    }
}
</script>
<style lang="scss" scoped>
.r_main {
    width: 100%;


    .tabIn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 23px 0;
        background-color: #E5E5E5;
        position: sticky;
        top: 99px;
        z-index: 99;
        padding: 0 23px;
        height: 60px;

        // border-top: 0.05rem solid #E8E8E8;
        .tab {
            font-weight: bold;
            font-size: 24px;
            color: #1068E7;
        }

        .btn2 {
            cursor: pointer;
            font-weight: 400;
            font-size: 14px;
            color: #FFFFFF;
            width: 82px;
            text-align: center;
            line-height: 34px;
            height: 34px;
            background: #1068E7;
            border-radius: 17px;
        }

    }

    .form_con {
        min-height: 500px;
        // overflow-y: auto;
    }
}

.outer {
    margin-top: 80px;
    display: flex;
    align-items: flex-start;
    padding-bottom: 20px;
    padding: 0 80px 20px;
    justify-content: space-between;

    .balance {
        height: 230px;
        width: 580px;
        background: #C98D1E;
        border-radius: 12px;
        padding: 30px 40px 40px;
        color: #fff;

        >div {
            display: flex;
            align-items: center;
        }

        .title {
            font-weight: 400;
            font-size: 40px;

            img {
                width: 44px;
                height: 41px;
                margin-right: 15px;
            }
        }

        .num {
            justify-content: space-between;
            margin-top: 40px;

            >span {
                font-weight: bold;
                font-size: 52px;
            }

            .btn {
                span {
                    cursor: pointer;
                    display: inline-block;
                    width: 100px;
                    color: #C98D1E;
                    height: 44px;
                    background: #FFFFFF;
                    border-radius: 22px;
                    margin-left: 20px;
                    line-height: 44px;
                    text-align: center;
                    font-weight: 400;
                    font-size: 24px;
                }
            }
        }
    }

    .zhuti {
        background: #2877E9;

        .title {

            img {
                width: 37px;
                height: 42px;
                margin-right: 15px;
            }
        }

        .num {
            .btn {
                span {
                    color: #2877E9;
                }
            }
        }
    }
}
@media screen and (max-width:768px) {
    .r_main .tabIn{
        height: 40px;
        padding: 0 20px;
        .tab{
            font-size: 15px;
        }
    }
    .outer{
        flex-wrap: wrap;
        .balance{
            padding: 20px;
            width: 100%;
            height: 120px;
            margin-bottom: 20px;
            .title{
                font-size: 20px;
                img{
                    width: 20px;
                    height: auto;
                    margin-right: 10px;
                }
            }
            .num{
                margin-top: 20px;
              >span{
                font-size: 16px;
              }  
              .btn{
                span{
                    width: 60px;
                    height: 25px;
                    font-size: 14px;
                    line-height: 25px;
                }
              }
            }
        }
    }
}
</style>